#include "classes/GUIClass.hpp"
#include "Objects/ButtonObject.hpp"
void GUIClass::MakeButton(GQE::App* theApp,GQE::ObjectManager* theObjectManager, std::string theText, std::string theAction, int theX, int theY)
{
    ButtonObject* newButton;
    newButton=new ButtonObject(theApp,"Button",GQE::ObjectVisible);
    theObjectManager->AddObject(newButton);
    newButton->SetText(theText);
    newButton->SetAction(theAction);
    newButton->SetPosition(theX,theY,0);
}
void GUIClass::MakeItemList(GQE::App* theApp,GQE::ObjectManager* theObjectManager, typeInventory* theInventory)
{
    unsigned int anItemIndex;
    ButtonObject* newButton;
    for(anItemIndex=0;anItemIndex<theInventory->size();anItemIndex++)
    {
        newButton=new ButtonObject(theApp,"Button",GQE::ObjectVisible);
        theObjectManager->AddObject(newButton);
        newButton->SetLong(true);
        if(theInventory->at(anItemIndex).Amount>1)
        {
            newButton->SetText(theInventory->at(anItemIndex).Item.Name+ " X"+JDD::IntToString(theInventory->at(anItemIndex).Amount));
        }
        else
        {
            newButton->SetText(theInventory->at(anItemIndex).Item.Name);
        }
        newButton->SetAction("Item");
        newButton->SetPosition(32,anItemIndex*16,0);
        newButton->SetIndex(anItemIndex);
    }
}
